
Ext.namespace('Ext.ux');

Ext.ux.NMapPanel = Ext.extend(Ext.Panel, {
    initComponent : function(){
        
        var defConfig = {
            plain: true,
            zoomLevel: 3,
            yaw: 180,
            pitch: 0,
            zoom: 0,
            gmapType: 'map',
            border: false
        };
        
        Ext.applyIf(this,defConfig);
        
        Ext.ux.NMapPanel.superclass.initComponent.call(this);        

    },
    afterRender : function(){
        
        var wh = this.ownerCt.getSize();
        Ext.applyIf(this, wh);
        
        Ext.ux.NMapPanel.superclass.afterRender.call(this);    
        this.nmap = new NMap(this.body.dom);
        this.nmap.setCenterAndZoom(new NPoint(321198,529730),3); 
    },
    example_addl : function() {
   		NEvent.addListener(this.nmap,"click",clicked);
    },
    example_reml : function() {
   		NEvent.removeListener(this.nmap,"click",clicked);
    },
    example_clicked : function(pos) {
  		Ext.MessageBox.alert(pos+" clicked");
    }
    
});

Ext.reg('nmappanel', Ext.ux.NMapPanel);
